package co.yixiang.retail.biz.product.mapper;

import co.yixiang.common.mproot.common.mapper.CoreMapper;
import co.yixiang.retail.common.domain.StoreProductStockValue;
import co.yixiang.retail.common.domain.YxStoreProductAttrValue;
import co.yixiang.retail.common.domain.YxStoreProductStockValue;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @author zhuhongjian
 * @date 2020-05-12
 */
@Repository
public interface StoreProductStockValueMapper extends CoreMapper<YxStoreProductStockValue> {

        @Select("SELECT stock FROM `yx_store_product_stock_value` WHERE store_id = #{storeId} and sku_id=#{id} ")
    StoreProductStockValue query(@Param("id") Long id,@Param("storeId")  Integer storeId);

        @Select("SELECT * from yx_store_product_stock_value where sku_id = #{skuId} and store_id = #{storeId}")
        YxStoreProductStockValue queryBySkuIdAndStoreId(@Param("skuId") Integer skuId, @Param("storeId") Integer storeId);
}
